package main

import (
	"svcfwin/config"
	"svcfwin/log"
	"svcfwin/server"
)

// 初始化日志系统

func main() {
	log.InitLog()
	if err := config.InitConfig(); err != nil {
		log.Log.Errorf("Failed to init config: %s", err)
		return
	}
	log.SetLogLevel(config.Config.Log.Level)
	if err := log.SetLogFile(config.Config.Log.File); err != nil {
		log.Log.Errorf("Failed to set log file: %s", err)
		return
	}
	log.Log.Infof("Successfully read config file")
	server.StartListener(config.Config.Port)
}
